home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / Dictionary.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  22KB  |  530 lines

  1. /*
  2.      File:        Dictionary.h
  3.  
  4.      Contains:    Dictionary Manager Interfaces
  5.  
  6.      Version:    Technology:    System 8
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __DICTIONARY__
  19. #define __DICTIONARY__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. #if FOR_SYSTEM8_PREEMPTIVE
  25. #ifndef __AEDATAMODEL__
  26. #include <AEDataModel.h>
  27. #endif
  28. #ifndef __AEREGISTRY__
  29. #include <AERegistry.h>
  30. #endif
  31. #ifndef __FILEMANAGERTYPES__
  32. #include <FileManagerTypes.h>
  33. #endif
  34. #endif
  35. #if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
  36. #ifndef __FILES__
  37. #include <Files.h>
  38. #endif
  39. #endif
  40.  
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif
  44.  
  45. #if PRAGMA_IMPORT_SUPPORTED
  46. #pragma import on
  47. #endif
  48.  
  49. #if PRAGMA_ALIGN_SUPPORTED
  50. #pragma options align=power
  51. /* the following contents can only be used by compilers that support PowerPC struct alignment */
  52.  
  53. /*
  54. =============================================================================================
  55.  System 8 Dictionary Manager
  56. =============================================================================================
  57. */
  58. #if FOR_SYSTEM8_PREEMPTIVE
  59. typedef UInt32 DCMUniqueID;
  60. #if FOR_PTR_BASED_AE
  61. typedef AERecord DCMFieldDataList;
  62. #endif
  63. typedef struct OpaqueDCMObjectID* DCMObjectID;
  64. typedef DCMObjectID DCMAccessMethodID;
  65. typedef DCMObjectID DCMDictionaryID;
  66. #define kDCMInvalidObjectID        ((DCMObjectID) kInvalidID)
  67. typedef struct OpaqueDCMObjectRef* DCMObjectRef;
  68. typedef DCMObjectRef DCMDictionaryRef;
  69. typedef DCMObjectRef DCMDictionaryStreamRef;
  70. typedef DCMObjectRef DCMFieldInfoRef;
  71. #define kDCMInvalidObjectRef    ((DCMObjectRef) kInvalidID)
  72. typedef struct OpaqueDCMObjectIterator* DCMObjectIterator;
  73. typedef DCMObjectIterator DCMAccessMethodIterator;
  74. typedef DCMObjectIterator DCMDictionaryIterator;
  75. typedef struct OpaqueDCMFoundRecordIterator* DCMFoundRecordIterator;
  76. /*
  77.     Field specification declarations
  78. */
  79. typedef FourCharCode DCMFieldTag;
  80. typedef FourCharCode DCMFieldType;
  81. typedef UInt64 DCMFieldSubType;
  82.  
  83. enum {
  84.     kDCMAnyFieldTag                = typeWildCard,
  85.     kDCMAnyFieldType            = typeWildCard
  86. };
  87.  
  88. /*
  89.     Dictionary information
  90. */
  91.  
  92. enum {
  93.     kDCMDictionaryHeaderVersion    = 1
  94. };
  95.  
  96. struct DCMDictionaryHeader {
  97.     FourCharCode                     headerSignature;
  98.     UInt32                             headerVersion;
  99.     ByteCount                         headerSize;
  100.     Str63                             accessMethod;
  101. };
  102. typedef struct DCMDictionaryHeader DCMDictionaryHeader;
  103.  
  104. typedef OptionBits DCMFieldAttribute;
  105.  
  106. enum {
  107.     kDCMIndexedFieldMask        = 0x00000001,
  108.     kDCMRequiredFieldMask        = 0x00000002,
  109.     kDCMIdentifyFieldMask        = 0x00000004,
  110.     kDCMFixedSizeFieldMask        = 0x00000008,
  111.     kDCMHiddenFieldMask            = 0x80000000
  112. };
  113.  
  114. /*
  115.     Standard dictionary properties
  116. */
  117.  
  118. enum {
  119.                                                                 /* created/updated by AccessMethod.*/
  120.                                                                 /* data type: typeSInt16*/
  121.     kDCMPermissionPropertyTag    = 'perm',                        /* created/updated by AccessMethod.*/
  122.                                                                 /* data type: typeSInt16*/
  123.     kDCMMaintenancePropertyTag    = 'mtnc',                        /* created by AccessMethod. default = kLocaleIdentifierWildCard.*/
  124.                                                                 /* data type: typeUInt32*/
  125.     kDCMLocalePropertyTag        = 'locl',                        /* optional.*/
  126.                                                                 /* data type: typeType*/
  127.     kDCMClassPropertyTag        = 'clas',                        /* optional.*/
  128.                                                                 /* data type: typeChar (ASCII string)*/
  129.     kDCMCopyrightPropertyTag    = 'info'
  130. };
  131.  
  132. /*
  133.     'perm' property constants
  134. */
  135.  
  136. enum {
  137.     kDCMReadOnlyDictionary        = 0,
  138.     kDCMReadWriteDictionary        = 1,
  139.     kDCMFrozenDictionary        = 2
  140. };
  141.  
  142. /*
  143.     Standard search method
  144. */
  145. typedef OSType DCMFindMethodType;
  146.  
  147. enum {
  148.     kDCMExactMatchMethod        = kAEEquals,
  149.     kDCMBeginningMatchMethod    = kAEBeginsWith,
  150.     kDCMContainsMatchMethod        = kAEContains,
  151.     kDCMEndingMatchMethod        = kAEEndsWith,
  152.     kDCMForwardTrieMethod        = 'ftri',                        /* used for morphological analysis*/
  153.     kDCMBackwardTrieMethod        = 'btri'                        /* used for morphological analysis*/
  154. };
  155.  
  156. /*
  157.     AccessMethod features
  158. */
  159. typedef OptionBits DCMAccessMethodFeature;
  160.  
  161. enum {
  162.     kDCMCanUseFileDictionaryMask = 0x00000001,
  163.     kDCMCanUseMemoryDictionaryMask = 0x00000002,
  164.     kDCMCanStreamDictionaryMask    = 0x00000004,
  165.     kDCMCanHaveMultipleIndexMask = 0x00000008,
  166.     kDCMCanModifyDictionaryMask    = 0x00000010,
  167.     kDCMCanCreateDictionaryMask    = 0x00000020,
  168.     kDCMCanAddDictionaryFieldMask = 0x00000040,
  169.     kDCMCanUseTransactionMask    = 0x00000080
  170. };
  171.  
  172. /*
  173.     Error values
  174. */
  175.  
  176. enum {
  177.     dcmParamErr                    = -7100,                        /* bad parameter*/
  178.     dcmNotDictionaryErr            = -7101,                        /* not dictionary*/
  179.     dcmBadDictionaryErr            = -7102,                        /* invalid dictionary*/
  180.     dcmPermissionErr            = -7103,                        /* invalid permission*/
  181.     dcmDictionaryNotOpenErr        = -7104,                        /* dictionary not opened*/
  182.     dcmDictionaryBusyErr        = -7105,                        /* dictionary is busy*/
  183.     dcmBadDictionaryTypeErr        = -7106,                        /* bad dictionary type*/
  184.     dcmBlockFullErr                = -7107,                        /* dictionary block full*/
  185.     dcmNoRecordErr                = -7108,                        /* no such record*/
  186.     dcmDupRecordErr                = -7109,                        /* same record already exist*/
  187.     dcmNecessaryFieldErr        = -7110,                        /* lack required/identify field*/
  188.     dcmBadFieldInfoErr            = -7111,                        /* incomplete information*/
  189.     dcmBadFieldTypeErr            = -7112,                        /* no such field type supported*/
  190.     dcmNoFieldErr                = -7113,                        /* no such field exist*/
  191.     dcmDupFieldErr                = -7114,                        /* field already exist*/
  192.     dcmBadKeyErr                = -7115,                        /* bad key information*/
  193.     dcmTooManyKeyErr            = -7116,                        /* too many key field*/
  194.     dcmBadDataSizeErr            = -7117,                        /* too big data size*/
  195.     dcmBadFindMethodErr            = -7118,                        /* no such find method supported*/
  196.     dcmBadPropertyErr            = -7119,                        /* no such property exist*/
  197.     dcmEndOfStreamErr            = -7120,                        /* reaches end of stream*/
  198.     dcmProtectedErr                = -7121,                        /* need keyword to use dictionary*/
  199.     dcmNoAccessMethodErr        = -7122,                        /* no such AccessMethod*/
  200.     dcmDupAccessMethodErr        = -7123,                        /* AccessMethod already exist*/
  201.     dcmBadFeatureErr            = -7124,                        /* invalid AccessMethod feature*/
  202.     dcmAccessMethodBusyErr        = -7125,                        /* AccessMethod is busy*/
  203.     dcmIterationCompleteErr        = -7126,                        /* no more item in iterator*/
  204.     dcmBufferOverflowErr        = -7127,                        /* data is larger than buffer size*/
  205.     dcmChangesCommittedErr        = -7128                            /* changes cannot be backed out*/
  206. };
  207.  
  208. /*
  209.     Callback routines
  210. */
  211. typedef OSStatus (*DCMRegisterStreamProc)(void *refcon, ByteCount maxSize, ByteCount *actualSize, LogicalAddress buffer);
  212. typedef Boolean (*DCMProgressProc)(void *refcon, Boolean determinateProcess, UInt16 percentageComplete);
  213. /*
  214.     Create dictionary
  215. */
  216. extern OSStatus DCMNewDictionary(DCMAccessMethodID accessMethod, FSObjectRef containerRef, ConstFSName dictionaryName, ItemCount numOfField, const DCMFieldInfoRef field[], Boolean invisible, ItemCount recordCapacity, DCMDictionaryID *newDictionary);
  217.  
  218. extern OSStatus DCMDeriveNewDictionary(DCMDictionaryID srcDictionary, FSObjectRef containerRef, ConstFSName dictionaryName, Boolean invisible, ItemCount recordCapacity, DCMDictionaryID *newDictionary);
  219.  
  220. /*
  221.     Register dictionary
  222. */
  223. extern OSStatus DCMRegisterDictionaryFile(FSObjectRef dictionaryFile, DCMDictionaryID *dictionaryID);
  224.  
  225. extern OSStatus DCMRegisterDictionaryStream(DCMRegisterStreamProc myRegisterProc, void *refcon, ByteCount dictionarySize, DCMDictionaryID *dictionaryID);
  226.  
  227. extern OSStatus DCMUnregisterDictionary(DCMDictionaryID dictionaryID);
  228.  
  229. /*
  230.     Open dictionary
  231. */
  232. extern OSStatus DCMOpenDictionary(DCMDictionaryID dictionaryID, ByteCount protectKeySize, LogicalAddress protectKey, DCMDictionaryRef *dictionaryRef);
  233.  
  234. extern OSStatus DCMCloseDictionary(DCMDictionaryRef dictionaryRef);
  235.  
  236. /*
  237.     Change access privilege
  238. */
  239. extern OSStatus DCMGetDictionaryWriteAccess(DCMDictionaryRef dictionaryRef, Duration timeOutDuration);
  240.  
  241. extern OSStatus DCMReleaseDictionaryWriteAccess(DCMDictionaryRef dictionaryRef, Boolean commitTransaction);
  242.  
  243. /*
  244.     Find records
  245. */
  246. extern OSStatus DCMFindRecords(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMFindMethodType findMethod, ItemCount preFetchedDataNum, DCMFieldTag preFetchedData[], ItemCount skipCount, ItemCount maxRecordCount, DCMFoundRecordIterator *recordIterator);
  247.  
  248. extern ItemCount DCMCountRecordIterator(DCMFoundRecordIterator recordIterator);
  249.  
  250. #if FOR_PTR_BASED_AE
  251. extern OSStatus DCMIterateFoundRecord(DCMFoundRecordIterator recordIterator, ByteCount maxKeySize, ByteCount *actualKeySize, LogicalAddress keyData, DCMUniqueID *uniqueID, DCMFieldDataList *dataList);
  252.  
  253. #endif
  254. extern OSStatus DCMDisposeRecordIterator(DCMFoundRecordIterator recordIterator);
  255.  
  256. /*
  257.     Dump dictionary
  258. */
  259. extern OSStatus DCMGetNextRecord(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID, ByteCount maxKeySize, ByteCount *nextKeySize, LogicalAddress nextKeyData, DCMUniqueID *nextUniqueID);
  260.  
  261. extern OSStatus DCMGetPrevRecord(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID, ByteCount maxKeySize, ByteCount *prevKeySize, LogicalAddress prevKeyData, DCMUniqueID *prevUniqueID);
  262.  
  263. extern OSStatus DCMGetNthRecord(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ItemCount serialNum, ByteCount maxKeySize, ByteCount *keySize, LogicalAddress keyData, DCMUniqueID *uniqueID);
  264.  
  265. extern OSStatus DCMGetRecordSequenceNumber(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID, ItemCount *sequenceNum);
  266.  
  267. /*
  268.     Get field data
  269. */
  270. #if FOR_PTR_BASED_AE
  271. extern OSStatus DCMGetFieldData(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID, ItemCount numOfData, const DCMFieldTag dataTag[], DCMFieldDataList *dataList);
  272.  
  273. extern OSStatus DCMSetFieldData(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID, DCMFieldDataList dataList);
  274.  
  275. #endif
  276. extern OSStatus DCMAnnotateTextObjectWithFieldData(DCMDictionaryRef dictionaryRef, DCMFieldTag keyTag, DCMUniqueID uniqueID, ItemCount numDataField, const DCMFieldTag data[], TextObject keyText);
  277.  
  278. /*
  279.     Add record
  280. */
  281. #if FOR_PTR_BASED_AE
  282. extern OSStatus DCMAddRecord(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, Boolean checkOnly, DCMFieldDataList dataList, DCMUniqueID *newUniqueID);
  283.  
  284. #endif
  285. extern OSStatus DCMDeleteRecord(DCMDictionaryRef dictionaryRef, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID);
  286.  
  287. extern OSStatus DCMCopyRecord(DCMDictionaryRef srcDictionary, DCMFieldTag keyFieldTag, ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID, DCMDictionaryRef targetDictionary, Boolean checkOnly, DCMUniqueID *newUniqueID);
  288.  
  289. /*
  290.     Add field
  291. */
  292. extern OSStatus DCMAddField(DCMDictionaryID dictionaryID, DCMFieldInfoRef fieldInfo, DCMProgressProc progressProcPtr, void *procRefcon);
  293.  
  294. extern OSStatus DCMDeleteField(DCMDictionaryID dictionaryID, DCMFieldTag fieldTag, DCMProgressProc progressProcPtr, void *procRefcon);
  295.  
  296. /*
  297.     Get dictionary information
  298. */
  299. extern OSStatus DCMCountRecord(DCMDictionaryID dictionaryID, ItemCount *count);
  300.  
  301. extern OSStatus DCMGetDictionaryInformarion(DCMDictionaryID dictionaryID, DCMAccessMethodID *accessMethod, Boolean *isProtected);
  302.  
  303. extern OSStatus DCMGetDictionaryFieldList(DCMDictionaryID dictionaryID, ItemCount maxFieldNum, ItemCount *actualFieldNum, DCMFieldTag fieldTag[], DCMFieldType fieldType[]);
  304.  
  305. extern OSStatus DCMGetDictionaryFieldInfo(DCMDictionaryID dictionaryID, DCMFieldTag fieldTag, DCMFieldInfoRef fieldInfo);
  306.  
  307. extern OSStatus DCMGetFileRefFromDictionaryID(DCMDictionaryID dictionaryID, FSObjectRef *fileRef);
  308.  
  309. extern OSStatus DCMGetDictionaryIDFromFile(FSObjectRef fileRef, DCMDictionaryID *dictionaryID);
  310.  
  311. extern DCMDictionaryID DCMGetDictionaryIDFromRef(DCMDictionaryRef dictionaryRef);
  312.  
  313. extern UInt32 DCMGetDictionaryChangeCount(DCMDictionaryID dictionaryID);
  314.  
  315. /*
  316.     Dictionary property
  317. */
  318. extern OSStatus DCMGetDictionaryProperty(DCMDictionaryID dictionaryID, DCMFieldTag propertyTag, ByteCount maxPropertySize, ByteCount *actualSize, LogicalAddress propertyValue);
  319.  
  320. extern OSStatus DCMSetDictionaryProperty(DCMDictionaryID dictionaryID, DCMFieldTag propertyTag, ByteCount propertySize, ConstLogicalAddress propertyValue);
  321.  
  322. extern OSStatus DCMGetDictionaryPropertyList(DCMDictionaryID dictionaryID, ItemCount maxPropertyNum, ItemCount *numProperties, DCMFieldTag propertyTag[]);
  323.  
  324. /*
  325.     Get dictionary stream
  326. */
  327. extern OSStatus DCMCreateDictionaryStream(DCMDictionaryID dictionaryID, DCMDictionaryStreamRef *stream);
  328.  
  329. extern OSStatus DCMReadDictionaryStream(DCMDictionaryStreamRef stream, ByteCount maxSize, ByteCount *actualSize, LogicalAddress buffer);
  330.  
  331. extern OSStatus DCMDisposeDictionaryStream(DCMDictionaryStreamRef stream);
  332.  
  333. /*
  334.     Reorganize/compact dictionary
  335. */
  336. extern OSStatus DCMReorganizeDictionary(DCMDictionaryID dictionaryID, ItemCount extraCapacity, DCMProgressProc progressProcPtr, void *procRefcon);
  337.  
  338. extern OSStatus DCMFreezeDictionary(DCMDictionaryID dictionaryID, DCMProgressProc progressProcPtr, void *procRefcon);
  339.  
  340. extern OSStatus DCMUnfreezeDictionary(DCMDictionaryID dictionaryID, ItemCount extraCapacity, DCMProgressProc progressProcPtr, void *procRefcon);
  341.  
  342. /*
  343.     Seaarch dictionary
  344. */
  345. extern OSStatus DCMCreateDictionaryIterator(DCMDictionaryIterator *dictionaryIterator);
  346.  
  347. extern OSStatus DCMFindDictionaryByField(DCMFieldTag desiredTag, DCMFieldType desiredType, DCMFieldAttribute attributeMask, ItemCount numOfFindMethod, const DCMFindMethodType neededMethods[], ByteCount requiredFieldSize, Boolean dataTypeTranslation, Boolean writeFieldData, Boolean findProtected, DCMDictionaryIterator dictionaryIterator);
  348.  
  349. extern OSStatus DCMFindDictionaryByProperty(DCMFieldTag propertyTag, ByteCount propertySize, ConstLogicalAddress propertyValue, DCMDictionaryIterator dictionaryIterator);
  350.  
  351. /*
  352.     Search AccessMethod
  353. */
  354. extern OSStatus DCMCreateAccessMethodIterator(DCMAccessMethodIterator *accessMethodIterator);
  355.  
  356. extern OSStatus DCMFindAccessMethodByField(DCMFieldType fieldType, Boolean keyField, ItemCount numOfFindMethod, const DCMFindMethodType neededMethods[], ByteCount requiredSize, Boolean dataTypeTranslation, DCMAccessMethodIterator accessMethodIterator);
  357.  
  358. extern OSStatus DCMFindAccessMethodByFeature(DCMAccessMethodFeature neededFeature, DCMAccessMethodIterator accessMethodIterator);
  359.  
  360. /*
  361.     Iterator Operation
  362. */
  363. extern ItemCount DCMCountObjectIterator(DCMObjectIterator iterator);
  364.  
  365. extern OSStatus DCMIterateObject(DCMObjectIterator iterator, DCMObjectID *objectID);
  366.  
  367. extern OSStatus DCMResetObjectIterator(DCMObjectIterator iterator);
  368.  
  369. extern OSStatus DCMDisposeObjectIterator(DCMObjectIterator iterator);
  370.  
  371. /*
  372.     Register AccessMethod
  373. */
  374. extern OSStatus DCMRegisterAccessMethod(FSObjectRef accessMethodFile, ItemCount maxAccessMethodNum, ItemCount *accessMethodNum, DCMAccessMethodID accessMethod[]);
  375.  
  376. extern OSStatus DCMUnregisterAccessMethod(DCMAccessMethodID accessMethod);
  377.  
  378. /*
  379.     Get AccessMethod information
  380. */
  381. extern OSStatus DCMGetAccessMethodInformation(DCMAccessMethodID accessMethod, ByteCount maxNameLen, ByteCount *nameLength, LogicalAddress libraryName, UInt32 *version, DCMAccessMethodFeature *feature);
  382.  
  383. extern OSStatus DCMGetAccessMethodFieldInfoList(DCMAccessMethodID accessMethod, ItemCount maxFieldNum, ItemCount *numOfField, DCMFieldInfoRef fieldInfo[]);
  384.  
  385. /*
  386.     Operators for DCMFieldInfoRef
  387. */
  388. extern OSStatus DCMCreateFieldInfoRef(DCMFieldInfoRef *fieldInfo);
  389.  
  390. extern OSStatus DCMDisposeFieldInfoRef(DCMFieldInfoRef fieldInfo);
  391.  
  392. extern OSStatus DCMSetFieldInfoTagType(DCMFieldInfoRef fieldInfo, DCMFieldTag fieldTag, DCMFieldType fieldType, const DCMFieldSubType *subType);
  393.  
  394. extern OSStatus DCMSetFieldInfoMaxSize(DCMFieldInfoRef fieldInfo, ByteCount maximumSize);
  395.  
  396. extern OSStatus DCMSetFieldInfoAttribute(DCMFieldInfoRef fieldInfo, DCMFieldAttribute attribute);
  397.  
  398. extern OSStatus DCMSetFieldInfoName(DCMFieldInfoRef fieldInfo, ItemCount numOfName, const ConstTextObject fieldName[]);
  399.  
  400. extern OSStatus DCMSetFieldInfoFindType(DCMFieldInfoRef fieldInfo, ItemCount numOfType, DCMFindMethodType findMethodType[]);
  401.  
  402. extern OSStatus DCMSetFieldInfoFindName(DCMFieldInfoRef fieldInfo, DCMFindMethodType findMethodType, ItemCount numOfName, const ConstTextObject findMethodName[]);
  403.  
  404. extern OSStatus DCMSetFieldInfoDefaultData(DCMFieldInfoRef fieldInfo, ByteCount dataSize, ConstLogicalAddress defaultData);
  405.  
  406. extern OSStatus DCMGetFieldInfoTagType(DCMFieldInfoRef fieldInfo, DCMFieldTag *fieldTag, DCMFieldType *fieldType, DCMFieldSubType *subType);
  407.  
  408. extern OSStatus DCMGetFieldInfoMaxSize(DCMFieldInfoRef fieldInfo, ByteCount *maximumSize);
  409.  
  410. extern OSStatus DCMGetFieldInfoAttribute(DCMFieldInfoRef fieldInfo, DCMFieldAttribute *attribute);
  411.  
  412. extern OSStatus DCMGetFieldInfoName(DCMFieldInfoRef fieldInfo, LocaleIdentifier nameLocale, TextObject fieldName);
  413.  
  414. extern OSStatus DCMGetFieldInfoNameList(DCMFieldInfoRef fieldInfo, ItemCount maxNameNum, ItemCount *numOfName, TextObject fieldName[]);
  415.  
  416. extern OSStatus DCMGetFieldInfoFindTypeList(DCMFieldInfoRef fieldInfo, ItemCount maxMethodNum, ItemCount *numOfMethod, DCMFindMethodType findMethodType[]);
  417.  
  418. extern OSStatus DCMGetFieldInfoFindName(DCMFieldInfoRef fieldInfo, DCMFindMethodType findMethodType, LocaleIdentifier nameLocale, TextObject findMethodName);
  419.  
  420. extern OSStatus DCMGetFieldInfoFindNameList(DCMFieldInfoRef fieldInfo, DCMFindMethodType findMethodType, ItemCount maxNameNum, ItemCount *numOfName, TextObject findMethodName[]);
  421.  
  422. extern OSStatus DCMGetFieldInfoDefaultData(DCMFieldInfoRef fieldInfo, ByteCount maxDataSize, ByteCount *actualSize, LogicalAddress defaultData);
  423.  
  424. /*
  425.     API for AccessMethod only
  426. */
  427. extern OSStatus DCMAddFoundRecordToIterator(ByteCount keySize, ConstLogicalAddress keyData, DCMUniqueID uniqueID, DCMFieldType fieldType[], ByteCount dataSize[], ConstLogicalAddress data[], DCMFoundRecordIterator recordIterator);
  428.  
  429. #endif
  430. /*
  431. =============================================================================================
  432.  System 7 Dictionary Manager
  433. =============================================================================================
  434. */
  435.  
  436. #pragma options align=reset
  437. #pragma options align=mac68k
  438. #endif /* PRAGMA_ALIGN_SUPPORTED */
  439.  
  440. #if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
  441.  
  442. enum {
  443.                                                                 /* Dictionary data insertion modes */
  444.     kInsert                        = 0,                            /* Only insert the input entry if there is nothing in the dictionary that matches the key. */
  445.     kReplace                    = 1,                            /* Only replace the entries which match the key with the input entry. */
  446.     kInsertOrReplace            = 2                                /* Insert the entry if there is nothing in the dictionary which matches the key, otherwise replaces the existing matched entries with the input entry. */
  447. };
  448.  
  449. /* This Was InsertMode */
  450. typedef short DictionaryDataInsertMode;
  451.  
  452. enum {
  453.                                                                 /* Key attribute constants */
  454.     kIsCaseSensitive            = 0x10,                            /* case sensitive = 16        */
  455.     kIsNotDiacriticalSensitive    = 0x20                            /* diac not sensitive = 32    */
  456. };
  457.  
  458.  
  459. enum {
  460.                                                                 /* Registered attribute type constants.    */
  461.     kNoun                        = -1,
  462.     kVerb                        = -2,
  463.     kAdjective                    = -3,
  464.     kAdverb                        = -4
  465. };
  466.  
  467. /* This Was AttributeType */
  468. typedef SInt8 DictionaryEntryAttribute;
  469. /* Dictionary information record */
  470. struct DictionaryInformation {
  471.     FSSpec                             dictionaryFSSpec;
  472.     SInt32                             numberOfRecords;
  473.     SInt32                             currentGarbageSize;
  474.     ScriptCode                         script;
  475.     SInt16                             maximumKeyLength;
  476.     SInt8                             keyAttributes;
  477. };
  478. typedef struct DictionaryInformation DictionaryInformation;
  479.  
  480. struct DictionaryAttributeTable {
  481.     UInt8                             datSize;
  482.     DictionaryEntryAttribute         datTable[1];
  483. };
  484. typedef struct DictionaryAttributeTable DictionaryAttributeTable;
  485.  
  486. typedef DictionaryAttributeTable *DictionaryAttributeTablePtr;
  487. extern pascal OSErr InitializeDictionary(const FSSpec *theFsspecPtr, SInt16 maximumKeyLength, SInt8 keyAttributes, ScriptCode script)
  488.  THREEWORDINLINE(0x303C, 0x0500, 0xAA53);
  489.  
  490. extern pascal OSErr OpenDictionary(const FSSpec *theFsspecPtr, SInt8 accessPermission, SInt32 *dictionaryReference)
  491.  THREEWORDINLINE(0x303C, 0x0501, 0xAA53);
  492.  
  493. extern pascal OSErr CloseDictionary(SInt32 dictionaryReference)
  494.  THREEWORDINLINE(0x303C, 0x0202, 0xAA53);
  495.  
  496. extern pascal OSErr InsertRecordToDictionary(SInt32 dictionaryReference, ConstStr255Param key, Handle recordDataHandle, DictionaryDataInsertMode whichMode)
  497.  THREEWORDINLINE(0x303C, 0x0703, 0xAA53);
  498.  
  499. extern pascal OSErr DeleteRecordFromDictionary(SInt32 dictionaryReference, ConstStr255Param key)
  500.  THREEWORDINLINE(0x303C, 0x0404, 0xAA53);
  501.  
  502. extern pascal OSErr FindRecordInDictionary(SInt32 dictionaryReference, ConstStr255Param key, DictionaryAttributeTablePtr requestedAttributeTablePointer, Handle recordDataHandle)
  503.  THREEWORDINLINE(0x303C, 0x0805, 0xAA53);
  504.  
  505. extern pascal OSErr FindRecordByIndexInDictionary(SInt32 dictionaryReference, SInt32 recordIndex, DictionaryAttributeTablePtr requestedAttributeTablePointer, Str255 recordKey, Handle recordDataHandle)
  506.  THREEWORDINLINE(0x303C, 0x0A06, 0xAA53);
  507.  
  508. extern pascal OSErr GetDictionaryInformation(SInt32 dictionaryReference, DictionaryInformation *theDictionaryInformation)
  509.  THREEWORDINLINE(0x303C, 0x0407, 0xAA53);
  510.  
  511. extern pascal OSErr CompactDictionary(SInt32 dictionaryReference)
  512.  THREEWORDINLINE(0x303C, 0x0208, 0xAA53);
  513.  
  514. #endif
  515.  
  516. #if PRAGMA_ALIGN_SUPPORTED
  517. #pragma options align=reset
  518. #endif
  519.  
  520. #if PRAGMA_IMPORT_SUPPORTED
  521. #pragma import off
  522. #endif
  523.  
  524. #ifdef __cplusplus
  525. }
  526. #endif
  527.  
  528. #endif /* __DICTIONARY__ */
  529.  
  530.